# @Author: k2017
# @Email: zk2017.com
# -*- coding: utf-8 -*-


import numpy as np
from collections import deque


class KNN(object):
    def __init__(self, k=7):
        self.k = k

    def _k_d_tree(self, x):
        """实现k_d树"""
        pass
        """
        1.计算所有特征里面方差最大的特征作为划分特征
        2.计算所选特征的中位数作为切分点
        3.生成其左右子树
        """
        var_x = np.apply_along_axis(np.var, axis=0, arr=x)
        max_var_idx = np.argmax(var_x)
        best_fea = x[:, max_var_idx]
        sorted(best_fea)
